<?php
namespace app\demo\model;

//use app\demo\model\Member;

/*class User extends Member
{

    public function show(){

        $feature = get_called_class();

        if(isset(self::$memberdata[$feature])){
            foreach (self::$memberdata[$feature] as $index => $item) {
                echo $index.':'.$item.'<br>';
            }
        }
    }
}*/


//创建子类:User,继承自:Member类
/*class User extends Member {

    //定义公共方法:show(),用来输出数据
    public  function show(){

        //获取调用当前方法的类名,如:User
        $feature = get_called_class();

        //如果self::$memberdata[$feature]属性存在
        if(self::$memberdata[$feature]){

            //输出与当前类所对应的$memberdata[$feature]属性值
            foreach(self::$memberdata[$feature] as $key=>$member){
                echo $key.':'.$member.'<br>';
            }
        }
    }

    //定义公共静态方法:show(),用来输出数据
    public static function showStatic(){

        //获取调用当前方法的类名,如:User
        $feature = get_called_class();

        //如果self::$memberdata[$feature]属性存在
        if(self::$memberdata[$feature]){

            //输出与当前类所对应的$memberdata[$feature]属性值
            foreach(self::$memberdata[$feature] as $key=>$member){
                echo $key.':'.$member.'<br>';
            }
        }
    }
}*/


//创建自定义模型类:User,假定与数据表User绑定
class User extends \TestModel {
    //这里是自定义模型类的代码
}



